package com.itheima.service.impl;

import com.itheima.dao.StudentDao;
import com.itheima.domain.Student;
import com.itheima.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("studentService")
public class StudentServiceImp implements StudentService {

    @Autowired
    private StudentDao studentDao;


    public List<Student> findAll() {
        return studentDao.findAll();
    }

    public void save(Student stu) {
            studentDao.save(stu);
    }

    public void delete(Integer sid) {
        studentDao.delete(sid);
    }

    public void update(Student stu) {
            studentDao.update(stu);
    }

    public Student findById(Integer sid) {
        return studentDao.findById(sid);
    }
}
